import { ContentTypeEnum } from '@/common/enums/httpEnum'
const Url = {
  payChannel: '/payment/channel',
  prepay: '/blend/reserve',
  payResult: '/blend/result',
  reserveSuccess: '/notify/reserve-room-succeed',
  BillPaySuccess: '/notify/bill-pay-succeed',
  billReceiptZreo: '/bill/receipt-zreo',
}

/**
 * @description: 预支付
 */
export const prePayment = (params) =>
  uni.$uv.http.post(Url.prepay, params, { header: { 'Content-Type': ContentTypeEnum.JSON }, custom: { showLoading: true, loadingMsg: '支付中' } })

/**
 * @description: 获取支付渠道
 */
export const getPayChannel = (params) => uni.$uv.http.get(Url.payChannel, { params, custom: {} })

/**
 * @description: 获取支付结果
 */
export const getPaymentRes = (params) => uni.$uv.http.get(Url.payResult, { params, custom: {} })

/**
 * @description: 预定成功接口 领取预定优惠券
 */
export const reserveSuccess = (params) => uni.$uv.http.post(Url.reserveSuccess, params)

/**
 * @description: 账单支付成功之后接口，变更账单状态
 */
export const BillPaySuccess = (params) => uni.$uv.http.post(Url.BillPaySuccess, params)

/**
 * @description: 账单支付金额为0时对冲接口
 */
export const billReceiptZreo = (params) => uni.$uv.http.post(Url.billReceiptZreo, params, { header: { 'Content-Type': ContentTypeEnum.JSON }, custom: { showLoading: true } })
